﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Core.Shop.Model
{
    public class ReturnModel
    {
        public bool IsSuccess { get; set; }
        public string Message { get; set; }
        public object Results { get; set; }
        public static ReturnModel Success(string msg = "操作成功！")
        {
            return new ReturnModel() { IsSuccess = true, Message = msg };
        }
        public static ReturnModel Fail(string msg)
        {
            return new ReturnModel() { IsSuccess = false, Message = msg };
        }
        public static ReturnModel Success<T>(T t, string msg = "操作成功!")
        {
            return new ReturnModel() { Message = msg, Results = t, IsSuccess = true };
        }
    }
    public class ReturnQueryModel
    {
        public object List { get; set; }
        public int Total { get; set; }
        public static ReturnQueryModel Success<T>(int total, T t)
        {
            return new ReturnQueryModel() { Total = total, List = t };
        }
    }
}
